def split_file(filename):
    num=0
    temp_content=[]
    i=1
    f=open(filename,"r")
    for line in f:
        if num<1000:
            num+=1
            i+=1
        else:
            temp=open("F:\\split"+str(i)+".txt","w")
            temp.writelines(temp_content)
            num=0
            temp_content=[]
            temp.close()
        temp_content.append(line)
    temp=open("F:\\split"+str(i+1)+".txt","w")
    temp.writelines(temp_content)
    temp.close()
    
   


def Merge_File(filename):
    merge_file=open("F:\\Merge_file.txt","w")
    for files in os.listdir(filename):
        temp_content=[]
        fread=open(filename+"\\"+files,"r")
        for line in fread:
            temp_content.append(line)
        merge_file.writelines(temp_content)
        merge_file.write("\n")
        fread.close()
    merge_file.close()